import React from "react";
import './style.css'
class Index extends React.PureComponent {
  handleClick = (e) => {
    /* 阻止默认行为 原生事件 */ 
    // e.preventDefault()
    // return false

    /* 阻止默认行为 合成事件 */
    // e.preventDefault()
    
  }
  render() {
    return (
      <div>
        <div className="q" onClick={() => console.log(1)}>
          <div className="w" onClick={() => console.log(2)}>
            <div className="e" onClick={(e) => { e.stopPropagation();console.log(3) }}></div>
          </div>
        </div>

        <a href="http://www.baidu.com" onClick={this.handleClick}>去百度</a>
      </div>
    );
  }
}

export default Index;
